package com.farm.test;



import com.farm.wcp.client.WcpClient;
import com.farm.wcp.client.utils.WdasJsonMap;

public class WpClientTestPost {
	public static void main(String[] args) {
		WcpClient client = new WcpClient("http://127.0.0.1:8080/wcp/api", "F59BD65F7EDAFB087A81D4DCA06C4910", "apiUser",
				"111111");
		client.bindRemotePost("40289ff486c974050186cabb7d74059d",null, "sysadmin");
		client.bindRemotePost("40289ff486c974050186cb119d2f0731",null, "sysadmin");
		client.clearAllPost("sysadmin");
	}
	public static void main2(String[] args) {
		WcpClient client = new WcpClient("http://127.0.0.1:8080/wcp/api", "F59BD65F7EDAFB087A81D4DCA06C4910", "apiUser",
				"111111");
		System.out.println(client.isLive(true));
		// 添加
		client.creatRemotePost("test2", "2c91808c7693489701769354c7a3003d", "测试岗位2", "2");
		// 修改
		client.editRemotePost("test2", "测试岗位2", "2");
		// 查询1
		WdasJsonMap node = client.getRemotePost("test2");
		System.out.println(node.getString("sourceid") + node.getString("name"));
		// 绑定人员
		client.bindRemotePost(node.getString("sourceid"), "test", "sysadmin");
		// 删除
		client.delRemotePost(node.getString("sourceid"));
		client.delRemotePost("test1");
		// 查询2
	}
}
